from flask import Flask
from flask_script import Manager    # Flask Script扩展提供向Flask插入外部脚本的功能
from flask_migrate import Migrate,MigrateCommand
from apps.house.models import *
from apps.user.models import *
from apps import create_app
from exts import db

app = create_app()
manager = Manager(app=app)

migrate = Migrate(app=app,db=db)    # Migrate包含了数据库的所有命令
manager.add_command('db',MigrateCommand)    # 添加db命令

if __name__ == '__main__':
    manager.run()
